import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from 'views/Entrance/Login'
import Register from 'views/Entrance/Register'
import HomePage from 'views/HomePage/HomePage'
import Original from 'views/Original/Original'
import OriginalDetailPage from 'views/DetailsPage/OriginalDetailPage'
import OriginalReadPage from 'views/DetailsPage/OriginalReadPage'
import uploadExplain from 'views/DetailsPage/Original/uploadExplain'
import CreationArea from 'views/DetailsPage/Original/CreationArea'
import Classification from 'views/Classification/Classification'
import Mine from 'views/Mine/Mine'
import MyWorks from 'views/DetailsPage/Mine/MyWorks'
import PersonalHomepage from 'views/DetailsPage/Mine/PersonalHomepage'
import myBookShelf from 'views/DetailsPage/Mine/myBookShelf'
import AdministratorInterface from 'views/DetailsPage/Mine/AdministratorInterface'
import AdministrationComment from 'views/DetailsPage/Mine/AdministrationComment'
import NodealDetailPage from 'views/DetailsPage/NodealDetailPage'
import NodealReadPage from 'views/DetailsPage/NodealReadPage'
import bookDetailPage from 'views/DetailsPage/bookDetailPage'
import bookReadPage from 'views/DetailsPage/bookReadPage'

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		redirect: '/login'
	},
	{
		path: '/homepage/:userid',
		component: HomePage
	},
	{
		path: '/classification/:tagid?',
		component: Classification
	},
	{
		path: '/original',
		component: Original
	},
	{
		path: '/mine',
		component: Mine
	},
	{
		// 书本详细页面
		path: '/bookdetailpage/:id',
		component: bookDetailPage
	},
	{
		// 书本阅读界面
		path: '/bookReadPage/:id',
		component: bookReadPage
	},
	{
		// 我的作品列表
		path: '/myworks',
		component: MyWorks
	},
	{
		// 上传说明
		path: '/uploadExplain',
		component: uploadExplain
	},
	{
		// 创作专区
		path: '/creationArea',
		component: CreationArea
	},
	{
		// 原创作品详情页
		path: '/originaldetailPage/:id',
		component: OriginalDetailPage
	},
	{
		// 原创作品阅读界面
		path: '/OriginalReadPage/:id',
		component: OriginalReadPage
	},
	{
		// 个人主页
		path: '/personalHomepage',
		component: PersonalHomepage
	},
	{
		// 管理员原创作品审核界面
		path: '/administratorInterface',
		component: AdministratorInterface
	},
	{
		// 管理员作品评论审核界面
		path: '/administrationComment',
		component: AdministrationComment
	},
	{
		// 未审核作品详情页
		path: '/nodealdetailPage/:id',
		component: NodealDetailPage
	},
	{
		// 未审核作品阅读界面
		path: '/nodealReadPage/:id',
		component: NodealReadPage
	},
	{
		// 我的书架
		path: '/mybookShelf',
		component: myBookShelf
		
	},
	{
		// 登录
		path: '/login',
		component: Login
	},
	{
		// 注册
		path: '/register',
		component: Register
	}
]

const router = new VueRouter({
	routes,
	linkActiveClass: 'active_router',//活跃的组件统一加class名为active_router
	// mode: 'history',
})

export default router;